package com.sky.service.impl;

import com.sky.entity.AddressBook;
import com.sky.mapper.AddressBookMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressBookServiceImpl implements com.sky.service.AddressBookService {

    @Autowired
    private AddressBookMapper addressBookMapper;
    @Override
    public void AddAddress(AddressBook addressBook) {
        addressBookMapper.AddAddress(addressBook);
    }

    @Override
    public List<AddressBook> GetAddressBookList(Long userId) {
        return addressBookMapper.GetAddressBookList(userId);
    }

    @Override
    public AddressBook GetAddressBookDefault(Long userId) {
        return addressBookMapper.GetAddressBookDefault(userId);
    }

    @Override
    public void UpdateAddressBook(AddressBook addressBook) {
        addressBookMapper.UpdateAddressBook(addressBook);
    }

    @Override
    public void deleteAddressBook(Integer id) {
        addressBookMapper.deleteAddressBook(id);
    }

    @Override
    public AddressBook getAddressBookById(Integer id) {
        return addressBookMapper.getAddressBookById(id);
    }

    @Override
    public void setAddressBookDefault(Integer id) {
        addressBookMapper.setAddressBookDefault(id);
    }
}
